﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/ViewPageStandart.master" AutoEventWireup="true" CodeBehind="InfoList.aspx.cs" Inherits="SiteLib.InfoList" %>

<%@ Import Namespace="SiteLib.Data" %>
<%@ Import Namespace="SiteLib.Tools" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphTitle" runat="server">
    <asp:Literal runat="server" ID="lMainContentTitle" />
    <asp:Literal runat="server" ID="lDate" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphSubMenu" runat="server">
    <asp:Panel runat="server" ID="pnlYearMenu" CssClass="blockSubMenu">
        <asp:Repeater runat="server" ID="rptSubMenu">
            <HeaderTemplate>
                <asp:Literal runat="server" ID="lOpenUl" Text="<ul class='pageSubMenu'>" />
            </HeaderTemplate>
            <ItemTemplate>
                <li>
                    <asp:HyperLink runat="server" ID="hlSubMenuLink" Text='<%# Container.DataItem %>' NavigateUrl='<%# String.Format("/InfoList.aspx?type={0}&year={1}", CurrentType, Container.DataItem) %>' CssClass='<%# GetYearStatus(Container.DataItem) %>' />
                </li>
            </ItemTemplate>
            <FooterTemplate>
                <asp:Literal runat="server" ID="lCloseUl" Text="</ul>" />
            </FooterTemplate>
        </asp:Repeater>
    </asp:Panel>
    <asp:Panel runat="server" ID="pnlCreatedDate" CssClass="blockSubMenu">
        <div class="titleDate">
            <asp:Label runat="server" ID="lCreatedDate" />
        </div>
    </asp:Panel>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphContent" runat="server">
    <asp:MultiView runat="server" ID="mvCompanyMessages">
        <asp:View runat="server" ID="vMessageList">
            <asp:Repeater runat="server" ID="rptMessages">
                <HeaderTemplate>
                    <asp:Literal runat="server" ID="lOpenUl" Text="<ul>" />
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <div style="overflow: hidden; width: 100%;">
                            <div class="ulHeader1">
                                <%# PageHelper.FormatDateString(Eval("CreateDate")) %>
                            </div>
                            <asp:Panel runat="server" ID="pAttachments" Visible='<%#((SiteContent)Container.DataItem).FileAttachements.Count > 0%>'>
                                <div class="ulHeader3">
                                    <asp:ImageButton runat="server" ImageUrl='<%# PageHelper.GetFileAttachemntsIcon(((SiteContent)Container.DataItem).FileAttachements.Count) %>' ToolTip='<%# String.Format("Количество файлов: {0}", ((SiteContent)Container.DataItem).FileAttachements.Count) %>' PostBackUrl='<%# String.Format("/InfoList.aspx?type={0}&id={1}", CurrentType, Eval("SiteContentId")) %>' />
                                </div>
                            </asp:Panel>
                            <div class="ulHeader2">
                                <asp:HyperLink runat="server" ID="hlListItem" Text='<%# Eval("Title") %>' NavigateUrl='<%# String.Format("/InfoList.aspx?type={0}&id={1}", CurrentType, Eval("SiteContentId")) %>' />
                            </div>
                        </div>
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    <asp:Literal runat="server" ID="lCloseUl" Text="</ul>" />
                </FooterTemplate>
            </asp:Repeater>
        </asp:View>
        <asp:View runat="server" ID="vMessageView">
            <asp:Repeater runat="server" ID="rptFiles">
                <HeaderTemplate>
                    <asp:Literal runat="server" ID="lOpenUl" Text="<ul class='fileList'>" />
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <asp:HyperLink runat="server" ID="hlSubMenuLink" Text='<%# Eval("DocumentName") %>' NavigateUrl='<%# String.Format("{0}/{1}", ConfigReader.SiteContentAttachmentPath, Eval("DocumentName")) %>' Target="_blank" ToolTip="Ссылка будет открыта в новом окне" />
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    <asp:Literal runat="server" ID="lCloseUl" Text="</ul>" />
                </FooterTemplate>
            </asp:Repeater>
            <asp:Literal runat="server" ID="lMainContent" />
        </asp:View>
    </asp:MultiView>
</asp:Content>
